import java.io.Serializable;
import java.util.Random;

public class MatrixInput implements Serializable {
	private int input1[][];
	private int input2[][];
	private int rows;
	private int cols;
	private int noOfSlaves;
	
	public MatrixInput (int rows, int cols, int noOfSlaves) {
		Random prng = new Random();
		this.rows = rows;
		this.cols = cols;
		this.noOfSlaves = noOfSlaves;
		input1 = new int[rows][cols];
		input2 = new int[rows][cols];
		for(int i = 0; i < rows; i++) {
			for(int j = 0; j < cols; j++) {
				input1[i][j] = prng.nextInt(10);
				input2[i][j] = prng.nextInt(10);
			}
		}	
	}

	public int[][] getInput1() {
		return input1;
	}
	
	public int[] getColumnMatrix(int colId) {
		int colMatrix[] = new int[input2[0].length];
		for(int i = 0; i < input2.length; i++) {
			colMatrix[i] = input2[i][colId]; 
		}
		return colMatrix;
	}

	public int getNoOfSlaves() {
		return noOfSlaves;
	}
	
	public void print() {
		System.out.println("Matrix 1:");
		for(int i = 0; i < rows; i++) {
			for(int j = 0; j < cols; j++) {
				System.out.print(input1[i][j] + " ");
			}
			System.out.printf("\n");
		}
		System.out.println("Matrix 2:");
		for(int i = 0; i < rows; i++) {
			for(int j = 0; j < cols; j++) {
				System.out.print(input2[i][j] + " ");
			}
			System.out.printf("\n");
		}
	}
}
